# 导包
import app


# 定义接口类
class AccountAPI:

    # 初始化
    def __init__(self):
        self.account_url = app.BASE_URL + '/trust/trust/register'
        self.get_code_top_up_url = app.BASE_URL + '/common/public/verifycode/{}'
        self.top_up_url = app.BASE_URL + '/trust/trust/recharge'

    # 定义开户方法
    def account(self, session):
        return session.post(self.account_url)

    # 定义获取充值验证码方法
    def top_up_code(self, session, r):
        return session.get(self.get_code_top_up_url.format(r))

    # 定义充值接口方法
    def top_up(self, session, amount, valicode="8888"):
        top_up_data = {"paymentType": "chinapnrTrust","formStr": "reForm","amount": amount,"valicode": valicode}
        return session.post(self.top_up_url, data=top_up_data)


















































